package com.suyang.syt.dao.impl;

import org.springframework.stereotype.Repository;

import com.suyang.syt.dao.interfaces.RoleResourcesPermissionDao;
import com.suyang.syt.model.RoleResourcesPermission;

/**
 * @author administrator
 * @date 2016-2-24 15:44:06
 * @description
 */
@Repository
public class RoleResourcesPermissionDaoImpl extends BaseDaoImpl<RoleResourcesPermission> implements RoleResourcesPermissionDao {
	/**
	 * 批量删除
	 */
	@Override
	public void deletes(String ids) {
		this.executeByHql("update RoleResourcesPermission set isDelete=1 where id in(" + ids + ")");
	}

	@Override
	public RoleResourcesPermission loadByRoleIdResourceId(long roleId, long resourceId) {
		return (RoleResourcesPermission) this.queryByHql("from RoleResourcesPermission where roleId=? and resourceId=?", new Object[] { roleId, resourceId });
	}

}
